package com.course.service.impl;

import com.course.component.util.SnowFlake;
import com.course.component.util.uuid.UUID;
import com.course.service.ToolService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @Copyright: Copyright (c)  林中小鸟  All rights reserved.
 * @author: moon
 * @date: 2022/9/21 18:25
 * @Description: **********************
 */
@Service
public class ToolServiceImpl implements ToolService {

    @Override
    public Map<String,String> getSnowId() {
        HashMap<String, String> res = new HashMap<>();
        String string = Long.toString(new SnowFlake().nextId());
        System.out.println(string);
        res.put("id",string);
        return res;
    }

    @Override
    public Map<String,String> getUUId() {
        HashMap<String, String> res = new HashMap<>();
        String string = UUID.fastUUID().toString();
        System.out.println(string);
        res.put("id",string);
        return res;
    }
}
